/*=============================================================================

  SYSTEM MANAGER EVENT DEFINITION

  FILE: SYSmgr_EVT.h
  
  DESCRIPTION

    Event Definition

  EXTERNALIZED FUNCTIONS

    
  Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

                             EDIT HISTORY

  ---------  -------  -------------------------------------------------------
    when       who     what, where, why
  ---------  -------  -------------------------------------------------------
   06/28/03   nso4th   Version 0.1

=============================================================================*/

#ifndef _SYSMGR_EVENT_H_
#define _SYSMGR_EVENT_H_

/*=============================================================================
  HEADER INCLUSION
=============================================================================*/

/*=============================================================================
  CONSTANT DEFINITION
=============================================================================*/
/*=============================================================================
  COMMAND DEFINITION
=============================================================================*/
typedef enum
{
	// Default event
	DEVINIT_START_E,
	DEVINIT_DONE_E,
	DEVCLOSE_START_E,
	DEVCLOSE_DONE_E,
	
	CHANGE_MAJSTATE_E,  // w: New State, l: Old State
	CHANGE_MINSTATE_E,  // w: New State, l: Old State
	CHANGE_PARAM_E,
	UI_UPDATE_E,

	// Default error
	ERR_DEVINIT_E = 0x80,
	ERR_DEVCLOSE_E,
	ERR_COMMAND_DENY_E,

	// Timer Event
	TIMER_0_E,
	TIMER_1_E,
	TIMER_2_E,
	TIMER_3_E,
	TIMER_4_E,
	TIMER_5_E,
	TIMER_6_E,
	TIMER_7_E,
	ERR_TIMEOUT_E = TIMER_0_E,

	SYSPREP_UPDATE_E, // w=new state, l=old state
	// TO DO: CUSTOM EVENT
	CUSTOM_BASE_E = 0x00FF,
	EGM_STATUS_E, // wp = staID, lp = newSTS
	
	// TO DO: CUSTOIM ERROR
	CUSTOM_ERR_BASE_E = 0x01FF,
	SYSTEM_ERR_E,  // wp = headID, lp = "(const char*)msg"
	SYSTEM_NOTI_E,  // wp = headID, lp = "(const char*)msg"
	
	// DEVICE Event
	INIT_START_E = HDEV_APPBASE_END_E,
	INIT_DONE_E,
	CLOSE_START_E,
	CLOSE_DONE_E,
	ERR_INIT_E,
	ERR_CLOSE_E,

} SYSmgr_Event_e;

#define IS_TIMER_EVENT(t, e)		(((t == SYS_MGR) && RANGE_IN(e, TIMER_0_E, TIMER_7_E)) ? (TRUE) : (FALSE))

#endif /* _SYSMGR_EVENT_H_ */


/*=============================================================================
  EXTERNALIZED FUNCTION DESCRPTIONS
=============================================================================*/
/*--- END OF SYSmgr_Event.H ---*/
